home *** CD-ROM | disk | FTP | other *** search
- //**********************************************************************************//
- // //
- // PowerFrax //
- // --------- //
- // //
- // Motorola compiler command line: //
- // mcc HFDocMandelbrot.c -c -i ::includes: -O3 //
- // //
- // © DayStar Digital, Inc. 1995-1996 //
- // All Rights Reserved. //
- // //
- //**********************************************************************************//
-
- #include "HFDocMandelbrot.h"
-
- //==================================================================================//
- long main( void *params )
- {
- // Generates one fractal scan. //
- // This is the MPWorkFunctionProc called from the tasks. //
- // When using the Multiprocessing API Library this function is called from fTask() //
- // in HFMultiprocessingPPC.c. When the Multiprocessing API Library is not present //
- // it is called directly from PowerFrax. //
-
- double lzc = ((sMandelbrotParamsPtr) params)->zc;
- double lzd = ((sMandelbrotParamsPtr) params)->zd;
- double lstep = ((sMandelbrotParamsPtr) params)->step;
- double lescape = ((sMandelbrotParamsPtr) params)->escape;
- long lwidth = ((sMandelbrotParamsPtr) params)->width;
- char* lresults = ((sMandelbrotParamsPtr) params)->results;
- long i;
-
- for (i = 0; i < lwidth; i++)
- {
- double za = 0.0;
- double zb = 0.0;
- double ze = 0.0;
- long level = 0;
- while( level < 256 && ze < lescape )
- {
- double za2 = za * za;
- double zb2 = zb * zb;
- double zt = za * zb;
- za = za2 - zb2 + lzc;
- zb = zt + zt + lzd;
- ze = za2 + zb2;
- level++;
- }
- *lresults++ = level - 1;
- lzc += lstep;
- }
- return( 0 );
- }
-
- //==================================================================================//
-